class YsError extends Error {
    constructor(message, type, data) {
        super(message)
        if (type) {
            this.type = type
        }
        if (data) {
            this.data = data
        }
        //Error.captureStackTrace(this, this.constructor)
    }
}

class NextError extends Error {
    constructor (message) {
        super(message)
        this.name = message
	this.type = 'NextError'
    }
}


module.exports = {YsError, NextError}
